import os

from constants.constant import TYPE_DISC
from model.AppInfo import AppInfo
from model.Config import Config
from utils.BatchChangeProperties import getErrorDir
from utils.FileUtil import save_excel, save_review_excel


def testSaveExcel():
    appInfo = AppInfo()
    appInfo.app_name = "测试"
    appInfo.package_name = "ccc"
    appInfo.order_id = 1
    adTypeDict = {}
    for adType in TYPE_DISC.keys():
        adTypeDict[adType] = {'adName':adType + "11",'adId':"11" }
    save_excel(adTypeDict, appInfo)

def testSaveReviewExcel():
    appInfoList = []
    for i in range(6):
        appInfo = AppInfo()
        appInfo.order_id = str(i)
        appInfo.app_name = str(i) + "appName"
        appInfo.package_name = str(i) + "packageName"
        appInfo.app_id = str(i) + "appId"
        appInfoList.append(appInfo)

    userConfig = Config().getUserConfig()
    save_review_excel(appInfoList, userConfig)


def testReadShareDisk():
    SHARD_DISK_PATH = r"\\192.168.1.200\游戏文件共享\鸿蒙项目\打包信息\ohos\test"
    for dir in os.listdir(SHARD_DISK_PATH):
        print(dir)


if __name__ == "__main__":
    # 测试save_excel函数
    # testSaveExcel()

    #测试save_review_excel
    # testSaveReviewExcel()

    # 获取失败的名单
    # getErrorDir()

    # 测试共享盘符读取
    testReadShareDisk()